package com.qianyu.api.controller.back.qqmag;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.qianyu.core.entity.base.Result;
import com.qianyu.core.entity.bean.QqAccount;
import com.qianyu.core.entity.dto.QqAccountDto;
import com.qianyu.core.service.QqAccountService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

@Api(tags = "后台管理-账号管理", description = "wangzhicheng")
@RestController
@RequestMapping("/api/qq")
@RequiredArgsConstructor
public class QqAccountController {
    private final QqAccountService qqAccountService;

    /**
     * 分页查询qq账号
     */
    @PostMapping("/pageList")
    @ApiOperation(value = "分页查询qq账号")
    Result<Page<QqAccount>> pageList(@RequestBody @Validated QqAccountDto.QqAccountPageDto dto) {
        return Result.success(qqAccountService.pageList(dto));
    }

    /**
     * 入号申请
     */
    @GetMapping("/applyAccount")
    @ApiOperation(value = "入号申请")
    Result<String> applyAccount(@RequestParam Integer num) {
        qqAccountService.applyAccount(num);
        return Result.success();
    }


}
